import { FormItem } from 'element-ui';
<!-- 账户创建与绑定 -->
<template>
	<div>
		<breadcrumb></breadcrumb>
		<div class="main">
			<div class="weidu">
				<div class="weidu_title">时间维度</div>
				<div class="weidi_big">
					<div @click="timeType(i)" :style="fromData.timeDimension == i
							? 'border: 1px solid #1890FF;background-color: #DDEEFD;color: #1890FF;'
							: ''
						" :class="i == 1 ? 'weidu_btn1' : 'weidu_btn'" v-for="(item, i) in timeList" :key="i">
						{{ item }}
					</div>
				</div>
			</div>
			<div class="weidu" style="margin-left: 20px">
				<div class="weidu_title">日期</div>
				<div style="margin-left: 10px">
					<el-date-picker v-model="fromData.startTime" value-format="yyyy-MM-dd" :type="type" :placeholder="timeName"
						:picker-options="pickerOptions">
					</el-date-picker>
				</div>
			</div>
			<div class="weidu" style="margin-left: 20px">
				<div class="weidu_title">对标日期</div>
				<div style="margin-left: 10px">
					<el-date-picker v-model="fromData.scalarStartTime" value-format="yyyy-MM-dd" :type="type"
						:placeholder="timeName" :picker-options="pickerOptions">
					</el-date-picker>
				</div>
			</div>
			<div class="weidu" style="margin-left: 20px">
				<div class="weidu_title">运营商</div>
				<div style="margin-left: 10px">
					<el-select v-model="fromData.supplierId" placeholder="请选择">
						<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
						</el-option>
					</el-select>
				</div>
			</div>

			<div style="margin-left: 20px;margin-top: 10px">
				<!-- 查询 -->
				<el-button type="primary" size="small" icon="el-icon-search" @click="cread()">查询</el-button>
				<el-button type="plain" size="small" icon="el-icon-refresh-right" @click="qinkong">清空</el-button>
			</div>
		</div>

		<div class="mon_box" v-if="mood">

			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/qian.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">总流水</div>
						<div class="cont_moeny">¥{{ mood.totalFunds ? parseFloat(mood.totalFunds).toFixed(2) : 0 }}</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.fundsScalarValue">¥{{ mood.fundsScalarValue }}</div>
						<div class="cont_qian" v-else>-</div>

					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.fundsIncreaseRate > 0">↑ {{ mood.fundsIncreaseRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.fundsIncreaseRate == null">-</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.fundsIncreaseRate }}%</div>

					</div>
				</div>
			</div>


			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/fanda.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">总完单</div>
						<div class="cont_moeny">{{ mood.carrierCompleteOrder+mood.operationCompleteOrder }}单</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.orderScalarValue">{{ mood.orderScalarValue }}单</div>
						<div class="cont_qian" v-else>-</div>

					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.orderIncreaseRate > 0">↑ {{ mood.orderIncreaseRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.orderIncreaseRate == null">-</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.orderIncreaseRate }}%</div>
					</div>
				</div>
			</div>
			
			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/fanda.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">承运完单数</div>
						<div class="cont_moeny">{{ mood.carrierCompleteOrder }}单</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.carrierScalarValue">{{ mood.carrierScalarValue }}单</div>
						<div class="cont_qian" v-else>-</div>
			
					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.carrierIncreaseRate > 0">↑ {{ mood.carrierIncreaseRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.carrierIncreaseRate == null">-
						</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.carrierIncreaseRate }}%</div>
			
					</div>
				</div>
			</div>
			
			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/car.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">撮合完单数</div>
						<div class="cont_moeny">{{ mood.operationCompleteOrder }}单</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.operationScalarValue">{{ mood.operationScalarValue }}单</div>
						<div class="cont_qian" v-else>-</div>
			
					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.operationIncreaseRate > 0">↑ {{ mood.operationIncreaseRate }}%
						</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.operationIncreaseRate == null">-
						</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.operationIncreaseRate }}%</div>
			
					</div>
				</div>
			</div>

			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/rentou.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">完单司机数</div>
						<div class="cont_moeny">{{ mood.completeOrderDriver }}人</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.driverScalarValue">{{ mood.driverScalarValue }}人</div>
						<div class="cont_qian" v-else>-</div>

					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.driverIncreaseRate > 0">↑ {{ mood.driverIncreaseRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.driverIncreaseRate == null">-</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.driverIncreaseRate }}%</div>
					</div>
				</div>
			</div>
			
			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/qian.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">承运流水</div>
						<div class="cont_moeny">¥{{ parseFloat(mood.perCarrierCapitaFlow).toFixed(2) }}</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.perCarrierScalarValue">¥{{ mood.perCarrierScalarValue }}</div>
						<div class="cont_qian" v-else>-</div>
			
					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.perCarrierIncreaseRate > 0">↑ {{ mood.perCarrierIncreaseRate }}%
						</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.perCarrierIncreaseRate == null">-
						</div>
			
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.perCarrierIncreaseRate }}%</div>
			
					</div>
				</div>
			</div>
			
			
			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/qian.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">撮合流水</div>
						<div class="cont_moeny">¥{{ parseFloat(mood.perOperationCapitaFlow).toFixed(2) }}</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.perOperationScalarValue">¥{{ mood.perOperationScalarValue }}
						</div>
						<div class="cont_qian" v-else>-</div>
					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.perOperationIncreaseRate > 0">↑
							{{ mood.perOperationIncreaseRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.perOperationIncreaseRate == null">-
						</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.perOperationIncreaseRate }}%
						</div>
			
					</div>
				</div>
			</div>

			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/qian.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">司机人均流水</div>
						<div class="cont_moeny">¥{{ parseFloat(mood.completeOrderDriver).toFixed(2) }}</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.perScalarValue">¥{{ mood.perScalarValue }}</div>
						<div class="cont_qian" v-else>-</div>
					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.perIncreaseRate > 0">↑ {{ mood.perIncreaseRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.perIncreaseRate == null">-</div>

						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.perIncreaseRate }}%</div>
					</div>
				</div>
			</div>
			
			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/fanda.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">未结算司机金额</div>
						<div class="cont_moeny">{{ mood.driverNotMoney==null?0:parseFloat(mood.driverNotMoney).toFixed(2) }}</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.driverNotMoneyValue">{{ mood.driverNotMoneyValue }}</div>
						<div class="cont_qian" v-else>-</div>
			
					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.driverNotMoneyValueRate > 0">↑
							{{ mood.driverNotMoneyValueRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.driverNotMoneyValueRate == null">-</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.driverNotMoneyValueRate }}%
						</div>
			
					</div>
				</div>
			</div>
			
			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/fanda.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">未结算承运金额</div>
						<div class="cont_moeny">{{ mood.supplierNotMoney==null?0:parseFloat(mood.supplierNotMoney).toFixed(2) }}</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.supplierNotMoneyValue">{{ mood.supplierNotMoneyValue }}</div>
						<div class="cont_qian" v-else>-</div>
			
					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.supplierNotMoneyValueRate > 0">↑
							{{ mood.supplierNotMoneyValueRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.supplierNotMoneyValueRate == null">-</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.supplierNotMoneyValueRate }}%
						</div>
			
					</div>
				</div>
			</div>
			
			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/fanda.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">人均准点率</div>
						<div class="cont_moeny">{{ parseFloat(mood.perPunctualityRate).toFixed(2) }}%</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.perPunctualityValue">{{ mood.perPunctualityValue }}%</div>
						<div class="cont_qian" v-else>-</div>
			
					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.perPunctualityIncreaseRate > 0">↑
							{{ mood.perPunctualityIncreaseRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.perPunctualityIncreaseRate == null">-</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.perPunctualityIncreaseRate }}%
						</div>
			
					</div>
				</div>
			</div>

			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/zhong.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">人均在线时长</div>
						<div class="cont_moeny">{{ mood.perCapitaOnlineDuration }}</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.perDurationScalarValue">{{ mood.perDurationScalarValue }}
						</div>
						<div class="cont_qian" v-else>-</div>

					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.perDurationIncreaseRate > 0">↑
							{{ mood.perDurationIncreaseRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.perDurationIncreaseRate == null">-
						</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.perDurationIncreaseRate }}%
						</div>

					</div>
				</div>
			</div>

			


			


			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/rentou.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">新增司机数</div>
						<div class="cont_moeny">{{ mood.newAddDriverNumber }}/{{ mood.driverNum }}人</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.addDriverScalarValue">{{ mood.addDriverScalarValue }}人</div>
						<div class="cont_qian" v-else>-</div>
					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.addDriverIncreaseRate > 0">↑ {{ mood.addDriverIncreaseRate }}%
						</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.addDriverIncreaseRate == null">-
						</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.addDriverIncreaseRate }}%</div>
					</div>
				</div>
			</div>



			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/car.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">新增车辆数</div>
						<div class="cont_moeny">{{ mood.newAddVehiclesNumber }}/{{ mood.vehicleNum }}辆</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.addVehiclesScalarValue">{{ mood.addVehiclesScalarValue }}辆
						</div>
						<div class="cont_qian" v-else>-</div>

					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.addVehiclesIncreaseRate > 0">↑
							{{ mood.addVehiclesIncreaseRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.addVehiclesIncreaseRate == null">-
						</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.addVehiclesIncreaseRate }}%
						</div>
					</div>
				</div>
			</div>

			

			<div class="cont_box">
				<div class="cont_sunBox">
					<img src="../../assets/img/qian.png" width="40px" height="40" />
					<div style="margin-left: 12px">
						<div class="cont_text">平台佣金统计</div>
						<div class="cont_moeny">¥{{ mood.brokerage ? parseFloat(mood.brokerage).toFixed(2) : 0 }}</div>
					</div>
				</div>
				<div class="line"></div>
				<div>
					<div class="cont_shuzi">
						<div class="cont_duibi">对标值</div>
						<div class="cont_qian" v-if="mood.brokerageScalarValue">¥{{ mood.brokerageScalarValue }}</div>
						<div class="cont_qian" v-else>-</div>

					</div>
					<div class="cont_shuzi" style="margin-top: 10px">
						<div class="cont_duibi">增长率</div>
						<div class="cont_shac" v-if="mood.brokerageIncreaseRate > 0">↑
							{{ mood.brokerageIncreaseRate }}%</div>
						<div class="cont_shac" style="color: #F55968;" v-else-if="mood.brokerageIncreaseRate == null">-</div>
						<div class="cont_shac" style="color: #F55968;" v-else>↓ {{ mood.brokerageIncreaseRate }}%
						</div>

					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
import breadcrumb from "@/components/breadcrumb.vue";
import httpApi from "@/http";
export default {
	data() {
		return {
			options: [],
			value: "",
			mood: {},
			timeList: ["年", "月", "日"],
			timeName: "选择月",
			type: "month",
			fromData: {
				timeDimension: 1,
				startTime: "",
				endTime: "",
				scalarStartTime: "",
				scalarEndTime: "",
				supplierId: "",
			},
			postData: {
				// timeDimension: 1,
				startTime: "",
				endTime: "",
				scalarStartTime: "",
				scalarEndTime: "",
				supplierId: "",
			},
			pickerOptions: {
				disabledDate(time) {
					return time.getTime() > Date.now();
				},
			},
		};
	},
	components: {
		breadcrumb,
	},
	created() {
		this.fellCread();
		this.codeTime();
	},
	methods: {
		qinkong() {
			this.postData.supplierId = "";
			this.fellCread();
			this.codeTime();
			this.fromData.timeDimension=1
			this.fromData.supplierId = "";
		},
		codeTime() {
			var date_now = new Date(); //获取当前时间
			var year = date_now.getFullYear(); //获取当前时间的年份
			var month = date_now.getMonth(); //获取当前时间的月份
			if (month == 1) {
				month = 1;
			}
			var day = date_now.getDate(); //获取当前时间的日
			var days = new Date(year, month, 0); //将获取到的年月赋值给days
			days = days.getDate(); //获取当前年月的日
			var year2 = year;
			var month2 = parseInt(month + 1); //获取当前月份的1一个月以后的月份
			if (month2 > 12) {
				year2 = parseInt(year2) + 1;
				month2 = parseInt(month2) % 12;
			} //考虑到12月要是获取一个月以后，就是一月，年份需要加一 ，一年没有13月，所以%12，取得来年1月
			var day2 = day;
			var days2 = new Date(year2, month2, 0);
			days2 = days2.getDate();
			if (day2 > days2) {
				day2 = days2;
			} //获取了当前年份的日和1个月以后的日，为的就是判断如果前一个月是有31号，后一个月没有，就将一个月以后的日期取到，赋值给day2
			if (month2 < 10) {
				month2 = "0" + month2;
			}

			let days1 = new Date(year, month + 1, 0).getDate();
			let days23 = new Date(year2, month2 + 1, 0).getDate();

			this.postData.startTime = year + "-" + month + "-" + 1 + " " + "00:00:00";
			this.postData.endTime =
				year + "-" + month + "-" + days1 + " " + "00:00:00";
			this.fromData.startTime = year + "-" + month + "-" + 1;

			this.postData.scalarStartTime = ''
			this.postData.scalarEndTime = ''

			this.fromData.scalarStartTime = ''
		},

		async analysisMood() {
			let res = await this.$http.driverApi.getOperational(this.postData);
			this.mood = res.data.data;

			this.mood.perCapitaOnlineDuration = this.formatSeconds(this.mood.perCapitaOnlineDuration * 1)
			this.mood.perDurationScalarValue = this.formatSeconds(this.mood.perDurationScalarValue * 1)
		},
		// value 秒 如果是毫秒 乘以1000即可

		formatSeconds(value) {
			var theTime = parseInt(value / 1000); // 秒
			var theTime1 = 0; // 分
			var theTime2 = 0; // 小时
			if (theTime > 60) {
				theTime1 = parseInt(theTime / 60);
				theTime = parseInt(theTime % 60);
				if (theTime1 > 60) {
					theTime2 = parseInt(theTime1 / 60);
					theTime1 = parseInt(theTime1 % 60);
				}
			}
			var result = "" + parseInt(theTime);
			if (result < 10) {
				result = "0" + result;
			}
			if (theTime1 > 0) {
				result = "" + parseInt(theTime1);
				if (theTime1 < 10) {
					result = "0" + result;
				}
			} else {
				result = 0
			}


			if (theTime2 > 0) {
				result = "" + parseInt(theTime2) + "时" + result + "分钟";
				if (theTime2 < 10) {
					result = "0" + result;
				}
			} else {
				result = 0
			}
			return result;
		},

		async fellCread() {
			let res = await this.$http.SettlementDocApi.listPullDown();
			let data = res.data.data.records;
			let mood = [];
			data.forEach((item, i) => {
				mood.push({
					value: item.supplierId,
					label: item.supplierName
				});
			});
			this.options = mood;
			this.analysisMood();
		},
		timeType(e) {
			this.fromData.timeDimension = e;
			if (e == 0) {
				this.timeName = "选择年";
				this.type = "year";
			} else if (e == 1) {
				this.timeName = "选择月";
				this.type = "month";
			} else {
				this.timeName = "选择日";
				this.type = "date";
			}
		},
		cread() {
			let data = {
				timeDimension: this.fromData.timeDimension,
				startTime: "",
				endTime: "",
				scalarStartTime: "",
				scalarEndTime: "",
				supplierId: this.fromData.supplierId,
			};
			let startTime = this.fromData.startTime;
			let scalarStartTime = this.fromData.scalarStartTime;
			if (this.fromData.startTime == this.fromData.scalarStartTime) {
				this.$message.error("请选择不同时间!");
				return;
			} else {
				if (this.type == "year") {
					data.startTime = parseInt(startTime.split("-")[0]) - 1 + "-12-31" + " 23:59:59";
					data.endTime = startTime.split("-")[0] + "-12-31" + " 23:59:59";

					if (scalarStartTime) {
						data.scalarStartTime = parseInt(scalarStartTime.split("-")[0]) - 1 + "-12-31" + " " + " 23:59:59";
						data.scalarEndTime = scalarStartTime.split("-")[0] + "-12-31" + " 23:59:59";
					}

				} else if (this.type == "month") {
					data.startTime = startTime + " " + "00:00:00";
					data.endTime =
						startTime.split("-")[0] +
						"-" +
						startTime.split("-")[1] +
						"-" +
						31 +
						" " +
						"23:59:59";

					if (scalarStartTime) {
						data.scalarStartTime = scalarStartTime + " " + "00:00:00";
						data.scalarEndTime =
							scalarStartTime.split("-")[0] +
							"-" +
							scalarStartTime.split("-")[1] +
							"-" +
							31 +
							" " +
							"23:59:59";
					}

				} else {
					data.startTime = startTime + " " + "00:00:00";
					data.endTime = startTime + " " + "23:59:59";

					if (scalarStartTime) {
						data.scalarStartTime = scalarStartTime + " " + "00:00:00";
						data.scalarEndTime = scalarStartTime + " " + "23:59:59";
					}

				}
				this.postData = {
					//   timeDimension: this.fromData.timeDimension,
					startTime: data.startTime,
					endTime: data.endTime,
					scalarStartTime: data.scalarStartTime,
					scalarEndTime: data.scalarEndTime,
					supplierId: this.fromData.supplierId,
				};
				this.analysisMood();
			}
		},
	},
	mounted() { },
};
</script>

<style lang="scss" scoped>
.cont_duibi {
	color: #99999f;
	font-size: 12px;
}

.cont_shac {
	font-size: 12px;
	color: #17b88b;
}

.cont_qian {
	font-size: 12px;
	color: #141414;
}

.cont_shuzi {
	width: 227.2px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-left: 25px;
}

.line {
	margin-top: 18px;
	margin-bottom: 14px;
	width: 227.2px;
	height: 1px;
	background-color: #dddddd;
	margin-left: 25px;
}

.cont_text {
	font-size: 12px;
	color: #4f4f4f;
}

.cont_moeny {
	margin-top: 9px;
	font-size: 20px;
	font-weight: 600;
}

.cont_box {
	width: 284.2px;
	background-color: #fff;
	border-radius: 2px;
	padding-bottom: 20px;
	margin-right: 20px;
	margin-top: 20px;
}

.cont_sunBox {
	display: flex;
	align-items: center;
	margin-left: 24px;
	padding-top: 22px;
}

.mon_box {
	padding: 29px 30px 33px 30px;
	padding-left: 3px;
	display: flex;
	flex-wrap: wrap;
}

.main {
	padding: 29px 30px 33px 30px;
	background-color: #fff;
	width: 100%;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

.weidu_title {
	font-size: 12px;
	color: #262626;
	font-weight: 600;
}

.weidu {
	display: flex;
	align-items: center;
}

.weidi_big {
	border-radius: 4px;
	border: 1px solid #dddddd;
	display: flex;
	align-items: center;
	margin-left: 20px;
}

.weidu_btn {
	width: 60px;
	height: 32px;
	text-align: center;
	line-height: 32px;
	background-color: #fff;
}

.weidu_btn1 {
	width: 60px;
	height: 32px;
	text-align: center;
	line-height: 32px;
	background-color: #fff;
	border-left: 1px solid #dddddd;
	border-right: 1px solid #dddddd;
}
</style>